package com.itheima.d2_collection_nesting;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

/*
      目标：理解集合的嵌套。
      江苏省 = "南京市","扬州市","苏州市","无锡市","常州市"
      湖北省 = "武汉市","孝感市","十堰市","宜昌市","鄂州市"
      河北省 = "石家庄市","唐山市", "邢台市", "保定市", "张家口市"
 */
public class Test {
    public static void main(String[] args) {
        HashMap<String, ArrayList<String>> map = new HashMap<>();
        ArrayList<String> l1 = new ArrayList<>();
        Collections.addAll(l1,"南京市","扬州市","苏州市","无锡市","常州市");
        ArrayList<String> l2 = new ArrayList<>();
        Collections.addAll(l2,"武汉市","孝感市","十堰市","宜昌市","鄂州市");
        ArrayList<String> l3 = new ArrayList<>();
        Collections.addAll(l3,"石家庄市","唐山市", "邢台市", "保定市", "张家口市");
        map.put("江苏省",l1);
        map.put("湖北省",l2);
        map.put("河北省",l3);

        map.forEach((t,v) -> {
            System.out.print(t + ": ");
            v.forEach(s -> System.out.print(s + " "));
            System.out.println();
        });
    }
}
